<template>
  <el-drawer :data="arr" v-model="drawer1" :with-header1="false">
    <div class="box">
      <span>收货员选择</span>
      <ul class="box1" v-for="(item, index) in arr" :key="index">
        <img src="/src/img/ShouHuo/logo1.png" alt="" />
        <li class="zT"><span :class=" [item.zTai == '休息中' ? 'active1' : 'active'] " ></span> <div>{{item.ename}}</div> <p class="p11">{{ item.fun }}</p></li>
        <el-button type="primary" color="#5E72E4" @click="$emit('mit',item.ename)" >派单</el-button>
      </ul>
    </div>
  </el-drawer>
</template>

<script setup>
import { ref } from "vue";
import { employeeList } from '../api/index'
const drawer1 = ref(false);

const open = () => {
  drawer1.value = !drawer1.value;
};
const arr = ref([])

employeeList().then((res)=>{
  arr.value =  res.data.data.employee.records
})

defineEmits(['mit'])



defineExpose({
  open,
});
</script>

<style lang="less" scoped>
.box1 {
  height: 83px;
  display: flex;
  border-bottom: 1px solid #ccc;
  line-height: 63px;
  img {
    width: 50px;
    height: 50px;
    margin: 0px 10px;
    margin-top: 15px;
  }
  button {
    margin-top: 25px;
    margin-left: 10px;
  }
}
.zT {
  font-size: 12px;
  color: #ccc;
  position: relative;
  top: 20px;
  left: -40px;
  margin-left: 10px;
    width: 100px;
    // background-color: red;
    text-align: center;
  span {
    width: 10px;
    height: 10px;
    border-radius: 10px;
    display: inline-block;
    position: absolute;
    top: 25px;
    left: 30px;
  }
  div{
    color: black;
    font-size: 16px;
    position: relative;
    top: -20px;
    text-align: left;
    width: 120px;
    margin-left: 30px;

  }
}
.text {
  position: relative;
  left: 20px;
}

.active{
    background-color: #FF0000;
}
.active1{
    background-color: #2DCE89;
}
.p11{
    position: relative;
    top: -65px;
    left: 20px;
}
</style>
